package com.group4.highschoolportal.teacher.backingBeans;

import com.group4.controller.GradeFacade;
import com.group4.controller.StudentFacade;
import com.group4.entity.Course;
import com.group4.entity.Grade;
import com.group4.entity.Student;
import com.group4.entity.Teacher;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;



/**
 *
 * @author Victor Cernea
 */
@ManagedBean
@SessionScoped
public class TeacherGradesBackingBean implements Serializable {
        
    private List<Student> student;
    private List<Grade> grades;
    private Teacher teacher;
    private List<Course> courses;
    
    
    public TeacherGradesBackingBean() {
        HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
        teacher = (Teacher) session.getAttribute("user");
        student = new ArrayList<Student>();
    
    }
    @PostConstruct
    private void init() {
        courses = teacher.getList();
        
    }

    public List<Grade> getGrades() {
        return grades;
    }

    public void setGrades(List<Grade> grades) {
        
        this.grades = grades;
    }

    public List<Student> getStudent() {
        return student;
    }

    public void setStudent(List<Student> student) {
        this.student = student;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    public List<Course> getCourses() {
        return courses;
    }

    public void setCourses(List<Course> courses) {
        this.courses = courses;
    }


    
    
}
